package by.grsu.coctails.db.task;

import java.util.List;

import android.content.Context;
import by.grsu.coctails.model.Ingredient;

public abstract class GetIngredientsAsyncTask extends
		CommonGetAsyncTask<Ingredient> {

	private String categoryName;

	public GetIngredientsAsyncTask(Context context, String categoryName) {
		super(context);
		this.categoryName = categoryName;
	}

	@Override
	protected List<Ingredient> load() {
		if (categoryName != null && !categoryName.equals("")) {
			return getDbManager().getIngredientByCategory(categoryName);
		}
		return getDbManager().getAllIngredients();
	}

	public String getCategoryName() {
		return categoryName;
	}

}
